package com.itheima.collection.genericity;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author Anomaly
 * @date 2023/1/1 20:01
 */
public class MyArrayList<E> {

    private List<E> list = new ArrayList<>();

    public void add(E e) {
        list.add(e);
    }

    public E get(int index) {
        return list.get(index);
    }

    public static <T> void printArray(T[] t) {
        System.out.println(Arrays.toString(t));
    }

    @Override
    public String toString() {
        return list.toString();
    }
}
